﻿namespace 一对一
{
    internal class Program
    {
        static void Main(string[] args)
        {
            using (MyDbContext ctx = new MyDbContext())
            {
                Order order = new Order();
                order.Name = "海苔";
                order.Address = "苏州";

                Delivery delivery = new Delivery();
                delivery.Order = order;
                delivery.CompanyName = "顺丰";
                delivery.Number = "1";

                ctx.Orders.Add(order);
                ctx.Deliverys.Add(delivery);
                ctx.SaveChanges();
            }
        }
    }
}
